package com.elong.android.specialhouse.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import com.elong.android.specialhouse.adapter.common.BasePowerAdapter;
import com.elong.android.specialhouse.adapter.common.BaseViewHolder;
import com.elong.android.specialhouse.adapter.common.MultiItemType;
import com.elong.infrastructure.ui.LetterSelectedListener;

import java.util.List;

/**
 * 
 * @interfaceName: CitySelectAdapter
 * @Description: 城市选择界面ListView的Adapter，需要实现LetterSelectedListener接口来与SideBar通信
 * @author kaiqi.li
 * @date 2015-8-3 下午7:29:35
 */
public abstract class CitySelectAdapter<T> extends BasePowerAdapter<T,BaseViewHolder> implements LetterSelectedListener {

	public CitySelectAdapter(Context context, int layoutId){
		super(context, layoutId);
	}
	
	public CitySelectAdapter(Context context, int layoutId, List<T> datas){
		super(context, layoutId, datas);
	}
	
	public CitySelectAdapter(Context context, List<T> datas, MultiItemType<T> multiItemType){
		super(context, datas,multiItemType);
	}
	
	@Override
	public BaseViewHolder getAdapterHolder(int position, View convertView,
			ViewGroup parent) {
		if (mMultiItemType != null) {
			return BaseViewHolder.get(mContext, convertView, parent, mMultiItemType.getLayoutId(position, mDatas.get(position)), position);
		}
		
		return BaseViewHolder.get(mContext, convertView, parent, mItemLayoutId, position);
	}
	
	
	
	

	
	
}
